package com.ccrfid.rmc6.entity.alarm;

import com.ccrfid.rmc6.entity.JsonBaseEntity;
import com.ccrfid.rmc6.entity.alarm.pojo.AlarmLevelDto;
import com.ccrfid.rmc6.entity.alarm.pojo.AlarmTypeDto;
import com.ccrfid.rmc6.entity.alarm.pojo.OrgDto;
import com.ccrfid.rmc6.entity.alarm.pojo.PersonnelDto;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table(name = "alarm_notify_strategy")
public class AlarmNotifyStrategyEntity extends JsonBaseEntity {
    private Long id;
    private String strategyName;
    private List<AlarmLevelDto> alarmLevels = new ArrayList<>();
    private List<AlarmTypeDto> alarmTypes = new ArrayList<>();
    private List<OrgDto> alarmPersonnelOrgs = new ArrayList<>();
    private List<PersonnelDto> alarmPersonnels = new ArrayList<>();
    private List<PersonnelDto> alarmNotifyPersonnels = new ArrayList<>();
    private Integer enabled;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "strategy_name", nullable = false)
    public String getStrategyName() {
        return strategyName;
    }

    public void setStrategyName(String strategyName) {
        this.strategyName = strategyName;
    }

    @Type(type = "json")
    @Column(name = "alarm_levels", columnDefinition = "json")
    public List<AlarmLevelDto> getAlarmLevels() {
        return alarmLevels;
    }

    public void setAlarmLevels(List<AlarmLevelDto> alarmLevels) {
        this.alarmLevels = alarmLevels;
    }

    @Type(type = "json")
    @Column(name = "alarm_types", columnDefinition = "json")
    public List<AlarmTypeDto> getAlarmTypes() {
        return alarmTypes;
    }

    public void setAlarmTypes(List<AlarmTypeDto> alarmTypes) {
        this.alarmTypes = alarmTypes;
    }

    @Type(type = "json")
    @Column(name = "alarm_personnel_orgs", columnDefinition = "json")
    public List<OrgDto> getAlarmPersonnelOrgs() {
        return alarmPersonnelOrgs;
    }

    public void setAlarmPersonnelOrgs(List<OrgDto> alarmPersonnelOrgs) {
        this.alarmPersonnelOrgs = alarmPersonnelOrgs;
    }

    @Type(type = "json")
    @Column(name = "alarm_personnels", columnDefinition = "json")
    public List<PersonnelDto> getAlarmPersonnels() {
        return alarmPersonnels;
    }

    public void setAlarmPersonnels(List<PersonnelDto> alarmPersonnels) {
        this.alarmPersonnels = alarmPersonnels;
    }

    @Type(type = "json")
    @Column(name = "alarm_notify_personnels", columnDefinition = "json")
    public List<PersonnelDto> getAlarmNotifyPersonnels() {
        return alarmNotifyPersonnels;
    }

    public void setAlarmNotifyPersonnels(List<PersonnelDto> alarmNotifyPersonnels) {
        this.alarmNotifyPersonnels = alarmNotifyPersonnels;
    }

    @Basic
    @Column(name = "is_enabled", nullable = false)
    public Integer getEnabled() {
        return enabled;
    }

    public void setEnabled(Integer enabled) {
        this.enabled = enabled;
    }
}
